<template>
    <div>
        <van-field v-model="form.name" label="名称" placeholder="请输入名称" />
        <van-button color="linear-gradient(to right, #7232dd, #ffffff)" @click="getCateByid" style="width:200px" id="add" >
                修改
        </van-button>
    </div>
</template>

<script>
    export default {
        data(){
            return{
                form:{id:this.$route.query.id}
            }
        },
        methods:{
            getCateByid(id){
                this.$axios.put('cateM?id='+this.form.id+'&name='+this.form.name)
                .then(res=>{
                    if(res.data.code==200){
                        this.$toast.fail('修改成功')
                        this.$router.push('/catelist')
                        
                    }
                })
            }
        },
    }
</script>

<style scoped>

</style>